The invention relates to image decoding, and in particular to methods and systems for decoding images conforming to JPEG format.
JPEG (Joint Photographic Experts Group) format is a popular static image compression technology. Currently, more than 90% of static image files conform to JPEG format.
JPEG format is commonly used as a file transfer format for multimedia communications. Generally, photos or images captured by digital cameras are pre-stored and then displayed or transmitted to computers for further editing process. Thus, a standard format, such as the JPEG format, which simultaneously compatible with the digital cameras and computers is required. Another reason for using the JPEG format is that JPEG image compression/encoding reduces huge storage requirement of image files. The memory-reduction feature is especially advantageous for specific application devices, such as mobile phones, digital cameras, or personal digital assistants (PDAs).
Two scan modes may be employed to JPEG images, baseline and progressive modes. An image can be divided into frames for encoding/decoding. While being scanned in baseline scan mode, an image frame is completely scanned at one time and all image information, such as hue values, is obtained from the onetime scan. While being scanned in progressive mode, the image frame is scanned repeatedly in each scan.
The baseline mode scan produces a simpler file structure that makes the corresponding JPEG decoder easier to implement. While presently JPEG decoders focus on baseline scan mode, JPEG decoders in progressive scan mode are however desirable in the future. Since the progressive mode produces a much more complex file structure, it raises a problem that the decoding speed by the traditional decoder becomes intolerably slow.
It is an important issue to have a better JPEG decoder for decoding JPEG images in either the baseline or progressive modes.
Huffman coding is an entropy encoding algorithm used for lossless data compression. The term “entropy encoding” refers to the use of a variable-length code table for encoding a source symbol where the variable-length code table has been derived based on the estimated probability of each possibly value of the source symbol. Huffman coding is currently used as compression method for multimedia coding, such as JEPG or MP3.
A JPEG image frame in progressive mode can be scanned by DC first scan, DC refine scan, AC first scan, or AC refine scan. If an image frame is scanned in DC scan, the scan contains only DCT (Discrete Cosine Transform) coefficient 0. If an image frame is scanned in AC scan, the scan contains no DCT coefficient 0. Additionally, a first scan means that a scan contains MSBs (most significant bits) of DCT coefficients and a refine scan means that a scan contains no MSBs of DCT coefficients. For progressive JPEG images, DC coefficients can be completely retrieved according to each DC first scan and DC refine scan. Similarly, AC coefficients can be fully regained according to each AC first scan and AC refine scan.